package test;

import java.util.LinkedList;

import scheduler.ILinkRepository;
import scheduler.LinkRepository;
import scheduler.CrawlerScheduler;
import server.CrawlerServer;
import structures.InfoPacket;
public class StartServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		LinkedList<String> l = new LinkedList<String>();
		l.add("http://student.agh.edu.pl/~wawro/test.html");
		ILinkRepository rep = new LinkRepository(l);
		CrawlerServer srv = new CrawlerServer(5775, new CrawlerScheduler(rep), rep, null,new InfoPacket());
		//srv.turnOn();	//tworzy wątek serwera, który trzeba potem ubić. do zaimplementowania : srv.kill()
		Thread t = new Thread(srv);
		t.start();
		//potrzebna synchronizacja crawlerConnection(!)
		try {
			t.join();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
